
<!doctype html>
<html lang="ch">
<head>
	<title>训练日教练招募!</title>
	<meta charset="utf-8" />
	<meta name="apple-touch-fullscreen" content="YES" />
	<meta name="format-detection" content="telephone=no" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="viewport" content="width=320, user-scalable=no">

	<meta http-equiv="Expires" CONTENT="0">
	<meta http-equiv="Cache-Control" CONTENT="no-cache">	
	<meta http-equiv="Pragma" CONTENT="no-cache">

	<link rel="stylesheet" type="text/css" href="/include/main.css" />
    <script type="text/javascript" src='/include/jquery.1.10.1.min.js'></script>
    <script type="text/javascript" src='/include/layer.m.js'></script>
 	<script type="text/javascript"  src="/include/ajaxfileupload.js"></script>

   
</head>

<style>
#headbox{  max-width: 700px; margin: auto; background-color: #eeeeee}
#regbox{ max-width: 700px; margin: auto; position: relative; background-image: url(/images/mainbg.jpg);background-size: cover; padding-top: 20px;}
#goodbox{max-width: 700px; margin: auto; position: relative; margin-top: 40px;}
#qabox{max-width: 700px; margin: auto; position: relative; margin-top: 40px;}
#qabox p{margin-top:20px; font-size:0.9em}


#regform{ position: relative; margin: auto; width: 90%;background-color: #ffffff; 	border-radius: 10px;
} 


.formgroup{height:45px;width: 100%;  clear: both;  position: relative; border-bottom: 1px solid #dddddd;  }
.formgroup h3{float: left; font-size:1.1em; line-height: 44px; height: 44px; width: 25%; padding-left: 10px;}
.formgroup_title{margin: 20px; position: relative;}
.formgroup_title span{height: 30px; line-height: 30px;}

.formtitle{line-height: 48px; height: 48px; text-align: center; font-size: 1.6em; 
	margin: 0px;  }

.formgroup input{
	border: 0px;
  font-size: 1.1em;
  padding: 8px 12px;
  width: 75%;
   float: right;
   height: 44px;
 }
 .formgroup textarea{
 	padding:10px;
 	  width: 75%;
  border: 0;
  height: 100px;
 }

.inputcontent{
	padding-top: 12px;
	width: 75%;
	float: right;
	height: 44px;
}
.buttondiv{
	padding: 5px; 
	padding-right: 15px;
	padding-left: 15px;
	border:1px solid #cccccc;
	border-radius: 10px;
}
.buttondiv_selected{
	padding: 5px; 
	padding-right: 15px;
	padding-left: 15px;
 	border-radius: 10px;
 	color: #ffffff;
	background-color: #0083e8;
	border:1px solid #0083e8;
}

.btn-primary {
  height: 45px;
  width: 100%;
  border-radius: 5px;
  font-family: ff-clan-web-pro-wide,sans-serif;
  font-size: 18px;
  background-color: #0083e8;
  color: #fff;
}
.btn {
  display: block;
  border: 0;
  text-align: center;
  text-transform: uppercase;
}
.clearbox{clear: both}
.blankbox{clear: both; height: 10px;}
.stypeselector{line-height: 35px}
.formdesc{font-size: 0.9em}
#userthumb{height: 64px; width: 64px; border-radius: 32px; }
.userablum{height: 64px; width: 64px;}

.bluelayer{text-align:center;background-color:#09C1FF; color:#fff; border:none;}
.mustspan{color:#ff3600; position:absolute;left:1px}


 .bnm_ul{
   margin-top:40px;
   margin-left:10px;
 }
  .bnm_ul li img{
      width:40%;
  }

 .bnm_ul li{
       float:left;
       width:150px;
       height:250px;
       text-align:center;
  }
  .bnm_ul li h3{
      line-height:50px;
   }
  .bnm_ul li p{
  	font-size:0.9em;
        color:#999999;
        padding-left:20px;
        padding-right:20px;
 }
.bigboxtitle{
height:50px; line-height:50px; border-bottom:1px solid #dddddd; text-align:center; font-size:22px; font-weight:bold;margin-top:60px;
}

</style>

<body>

<div id="headbox" style="display:none">
     <img src="/images/regtop.jpg" style="width:100%">
</div>

<div id="regbox">


     <div id="regform" >

		     <!-- step 1 -->
		       <div id="step1" style=" position:relative; ">
			          <div class="formgroup formtitle"  >
			               立即加入
			          </div>
			          <div class="formgroup">
			               <h3><span class="mustspan">*</span>姓名</h3>
						   <input type="input" value="" name="fullname" id="fullname" placeholder="姓名">
		 	          </div>
			          <div class="formgroup">
			               <h3><span class="mustspan">*</span>性别</h3>
			               <div class="inputcontent">
			                    <span svar='1' class="sexselector buttondiv">帅哥</span> 
			                    <span svar='2' class="sexselector buttondiv">美女</span> 
 			               </div>
		 	          </div>
			          <div class="formgroup">
			               <h3><span class="mustspan">*</span>身高</h3>
						   <input type="input" value="" name="height" id="height" placeholder="厘米">
		 	          </div>
			          <div class="formgroup">
			               <h3>体重</h3>
						   <input type="input" value="" name="weight" id="weight" placeholder="公斤">
		 	          </div>
			          <div class="formgroup">
			               <h3>出生年月</h3>
						   <input type="input" value="" name="birthday" id="birthday" placeholder="格式:1990-01-01">
			          </div>

			          <div class="formgroup">
			               <h3><span class="mustspan">*</span>手机号</h3>
						   <input type="input" value="" name="phonenumber" id="phonenumber" placeholder="请输入正确的手机号码">
		 	          </div>

			          <div class="formgroup">
			               <h3>qq号</h3>
						   <input type="input" value="" name="qqnumber" id="qqnumber" placeholder="qq号码">
		 	          </div>

		 	          <div class="formgroup" style="height:150px">
			               <h3><span class="mustspan">*</span>擅长项目</h3>
			               <div class="inputcontent" id="stypeselectdiv">
					            <span svar="1" selectstatus="unselected" class="stypeselector buttondiv">健身</span> 
			                    <span svar="2" selectstatus="unselected" class="stypeselector buttondiv">羽毛球</span> 
			                    <span svar="3" selectstatus="unselected" class="stypeselector buttondiv">网球</span> 
					            <br>

					            <span svar="4" selectstatus="unselected" class="stypeselector buttondiv">高尔夫</span> 
					            <span svar="5" selectstatus="unselected" class="stypeselector buttondiv">游泳</span> 
					            <span svar="6" selectstatus="unselected" class="stypeselector buttondiv">瑜伽</span> 
					            					            <br>

					            <span svar="7" selectstatus="unselected" class="stypeselector buttondiv">跑步</span> 
					            <br>
					            <span class="formdesc">*最多可选择三项</span>
			               </div>
		 	          </div>

			          <div class="formgroup">
			               <h3>其他项目</h3>
						   <input type="input" value="" name="orthertype" id="orthertype" placeholder="如果以上没有列出请填写">
		 	          </div>

			          <div class="formgroup">
			               <h3>邀请码</h3>
						   <input type="input" value="" name="invitecode_f" id="invitecode_f" placeholder="如果有邀请码请填写">
		 	          </div>


		 	          <div class="formgroup" style="height:60px;padding:10px; text-align:center; font-size:0.9em; color:#f45110">
		 		            教练入驻即可获赠8-20元现金红包,<br>&nbsp;邀请教练入驻可获10元现金红包。
 		 	          </div>
		 	          <div class="blankbox"></div>

		        </div>




		     <!-- step 2 -->
		       <div id="step2" style="display:none">
			          <div class="formgroup formtitle"  >
			               输入收到的验证码
			          </div>
			          <div class="formgroup" style="color:#ca3900; line-height: 44px; padding-left: 20px;">
			               验证码短信已经发到<span id="sendphonenumber"></span>
		 	          </div>
			          <div class="formgroup">
			               <h3><span class="mustspan">*</span>验证码</h3>
						   <input type="input" value="" name="smscode" id="smscode" placeholder="输入手机收到的验证码">
			          </div>

 
			          <div class="formgroup">
			               <h3><span class="mustspan">*</span>设置密码</h3>
						   <input type="password" maxlength="20" value="" name="password" id="password" placeholder="设置一个训练日登陆密码">
		 	          </div>

 		 	          <div class="blankbox">
		 	          </div>
		        </div>

		        <div id="step4" style="display:none ">
					    <div class="formgroup formtitle" >
					               注册成功!
					    </div>
					    <div class="formgroup" style="height:350px">
					               <h3>客服微信</h3>
					               <div class="inputcontent" >
					                    <img src="/images/kfcode.jpg" style="width:80%; max-width: 250px;"	>
					               <div style="width:90%; margin-top:10px">
					                   扫一扫以上的二维码(或添加微信好友ydsd_ss)，加客服了解入驻进度！
					                   <br> 还有更多惊喜等着你！
					               </div>
					               </div>
					    </div>


		        </div>


		 
		     <!-- step 3 -->
		        <div id="step3" style="display:none">
					          <div class="formgroup formtitle" >
					               展示你自己
					          </div>
 					          <div class="formgroup" style="height:100px">
					               <h3>上传头像</h3>
					               <div class="inputcontent">
					                    <img src="/images/icon/user.png" id="userthumb"> 
  
		                <input id="userthumbfile" name="file" type="file" accept="image/*;capture=camera" onchange="upload('userthumbfile')" style="opacity:0; height:1px; width:1px; -webkit-appearance: none;  -moz-appearance: none; appearance: none; overflow: hidden;  " >

					               </div>
					          </div>

					          <div class="formgroup" style="height:100px; display:none  ">
					               <h3>上传帅照</h3>
					               <div class="inputcontent">
					                    <img src="/images/icon/plus.png" class="userablum"> 
					               </div>
					          </div>

		 				     <div class="formgroup" style="height:101px;">
					               <h3>执教经历</h3>
				 				   <textarea name="resume" id="resume" placeholder="简单介绍一下曾执教的经历"></textarea>
 							  </div>

		 			          <div class="formgroup" style="height:101px;">
					               <h3>相关证书</h3>
		 						   <textarea name="sporttitle" id="sporttitle" placeholder="曾获得的相关证书，多个以回车分行"></textarea> 
				 	          </div>

		 
				 	          <div class="formgroup" style="height:101px;">
					               <h3>自我介绍</h3>
				 				   <textarea name="selfintro" id="selfintro" placeholder="一两句话介绍你自己"></textarea>
						 			  <div class="clearbox"></div>
							  </div>


 		 	          <div class="blankbox">
		 	          </div>
			    </div> <!-- end 3 -->



	</div>		    

	      <div style="width:90%;  text-align:center; margin:auto; margin-top:20px;">
				  <button id="submitButton" type="" class="btn btn-primary">
				     <div id="submitButtonText">下一步</div>
				  </button>
	      </div>

	 	  <div style="height:20px;">
	       </div>

</div>


	<div id="goodbox">
    <div class="bigboxtitle">
         为什么加入训练日
    </div>
     <ul class="bnm_ul">
          <li>
               <div><img src="/images/bn_1.png">
               </div>
               <h3>随时获取学员订单</h3>
               <p>随时获取来自训练日APP、公众号平台的订单，学员信息源源不断</p>
          </li>
          <li>
               <div><img src="/images/bn_2.png">
               </div>
               <h3>在线发布课程</h3>
               <p>可通过专属后台发布自己的课程信息、在线招生、随时管理课时</p>
          </li>
          <li>
               <div><img src="/images/bn_3.png">
               </div>
               <h3>自由接单</h3>
               <p>自由安排课程，自由选择学员，随心所欲</p>
          </li>


          <li>
               <div><img src="/images/bn_4.png">
               </div>
               <h3>精美认证空间</h3>
               <p>精美的H5/网页等个人空间，通过微信qq等进行展示和招生</p>
          </li>
          <li>
               <div><img src="/images/bn_5.png">
               </div>
               <h3>互动空间</h3>
               <p>与学员们进行交流互动,相互提高，还可以约个球、交个朋友</p>
          </li>
          <li>
               <div><img src="/images/bn_6.png">
               </div>
               <h3>成长体系</h3>
               <p>我们为教练量身定做成长体系，为你升级打造</p>
          </li>
          <div class="clearbox"></div>
      </ul>


	</div>




	<div id="goodbox" style="display:none">
	      <div style="float:left;width:30%; padding:20px; text-align:center">
	           <img src="/images/logo2.png" style="width:100%">
	      </div>
	      <div style="float:right;width:70%;padding:20px; line-height:1.8em; font-size:1.3em">
				训练日是一个专业的运动约练平台，
				入驻后可以：<br>
				·通过训练日APP、公众号随时获取
				   学员订单随时安排训练教学<br>
				·实时管理自己的课程表<br>
				·发布训练课程、获取精准学员<br>
				·获取精美个人认证空间，通过训练日
				   和微信等进行展示<br>
				·与运动达人们一起交流切磋<br>
				*训练日平台正在招募中，即将全城开放
	      </div>
	      <div class="clearbox"></div>
	</div>

	<div id="qabox">
	     <div style="border-bottom:1px solid #999999; text-align:center; font-weight:bold; font-size:1.8em; height:40px; line-height:20px;">
	     Q&A
	     </div>
	     <div style="padding:40px; line-height:1.8em; font-size:1.3em"  >
	        <p  style="margin-top:0px">
1、谁可以申请入驻？<br>
     有相关的教练资格证明，具备一种及以上的体育特长。
           </p>

	        <p>
2、如何进行认证？<br>
     申请入驻填写资料后，我们的客服会与你进行联系
       完成认证过程。           </p>


	        <p>
3、如何发布课程信息？<br>
     登陆网站、公众号或APP进行发布 。
          </p>

	        <p>
4、如何接收和管理订单？<br>
     登陆网站、公众号或APP进行管理 。
          </p>

	     </div>

	</div>


	<div id="tail" style="background-color:#dddddd; height:100px;">
         <div style="text-align:right; width:100%; max-width:700px; margin:auto; padding:20px; font-size:1.1em; line-height:1.8em">
            深圳市悦动时代科技有限公司
            <br>
            联系我们: 0755-83995459 

         </div>
	</div>




<script type="text/javascript">

   var sexvar = '';
   var userid = '';
   var phonenumber = '';

   $(".sexselector").on('click',function(){
        var selectedvar = $(this).attr("svar");
        $(".sexselector").removeClass("buttondiv_selected");
        $(".sexselector").addClass("buttondiv");
        $(this).addClass("buttondiv_selected");
        $(this).removeClass("buttondiv");
        sexvar = selectedvar;
   });

   $(".stypeselector").on('click',function(){

 
   	    var selectstatus = $(this).attr("selectstatus");
   	    if(selectstatus=='selected'){
           $(this).attr("selectstatus","unselected");
           $(this).removeClass("buttondiv_selected");
           $(this).addClass("buttondiv");
   	    }else{

		   	   if($('#stypeselectdiv .buttondiv_selected').length > 2){
		   	   	   //alert("最多只允许选择3项");
                 layer.open({
				    content: '最多只允许选择3项',
				    className: 'bluelayer',
				    time: 2
				});

		   	   	   return;
		   	   }

           $(this).attr("selectstatus","selected");
           $(this).removeClass("buttondiv");
           $(this).addClass("buttondiv_selected");

   	    }
 
   	      
   });
 
   $("#userthumb").on('click',function(){
         $("#userthumbfile").click();
   });


  function upload (fileupload_id) {

	  	layer.open({
		    content: '正在上传',
		    className: 'bluelayer'
		});

   
       $("#uploadbg").attr("src","images/uploadbg2.png"); 
      
        $.ajaxFileUpload({
             url         :'/api_fileupload.php',
             secureuri   :false,
             fileElementId  : fileupload_id ,
             dataType    : 'json',
             success: function (data, status)            //相当于java中try语句块的用法
             {
                 $("#userthumb").attr("src",data.filepath);

                  layer.open({
				    content: '上传成功',
				    className: 'bluelayer',
				    time: 1
				});

             },
             error: function (data, status, e)            //相当于java中catch语句块的用法
             {
                layer.open({
				    content: '出错了!可能是网络有点慢,请尝试从手机相册中选择照片上传',
				    tbtn: ['OK']
				});
                //$("#uploadbg").attr("src","images/uploadbg.png"); 
              }

         });
          return true;
   }



    var currentstep = 1;
    $("#submitButton").on('click',function(){
    	if(currentstep==1){
	         //$("#step1").fadeOut(300);
 	         sendInfo_1();
      	}
    	if(currentstep==2){
 	         sendInfo_2();
     	}
    	if(currentstep==3){
             sendInfo_3();
     	}
 
    });

    function showlayer(showword){
			layer.open({
			    content:showword,
			    style: 'background-color:#09C1FF; color:#fff; border:none;',
			    time: 2
			});
    }

    function sendInfo_1(){

 	    //获取所选取的
 	    var stype_arr = new Array();
 	    var stype_str = '';
		$("#stypeselectdiv .buttondiv_selected").each(function(i){
			stype_arr[i] = $($("#stypeselectdiv .buttondiv_selected")[i]).attr("svar");
			stype_str = stype_str + ',' + $($("#stypeselectdiv .buttondiv_selected")[i]).attr("svar");
		});

 	    var fullname = $("#fullname").val();
 	    var phonenumber = $("#phonenumber").val();
 	    var qqnumber = $("#qqnumber").val();
 	    var sex = sexvar;
 	    var height = $("#height").val();
 	    var weight = $("#weight").val();
 	    var birthday = $("#birthday").val();
 	    var sporttypes = stype_str;
 	    var sporttitle = $("#sporttitle").val();
 	    var orthertype = $("#orthertype").val();
 	    var invitecode_f = $("#invitecode_f").val();


 	    layer.open({
		    content: '正在注册',
		    className: 'bluelayer'
		});

        $.ajax({
            url: '/api_createinfo_1.php',
            type: 'POST',
            data:{ fullname:fullname,phonenumber:phonenumber,qqnumber:qqnumber,sex:sex,height:height,weight:weight,birthday:birthday,sporttypes:sporttypes,sporttitle:sporttitle,orthertype:orthertype,invitecode_f:invitecode_f},
            dataType: 'json',
            error: function(){
                  alert('Error loading PHP document'); 
                  posting = false;
                 },
            success: function(result){

 
            	if(result.result==4){
                       layer.open({
						    content: '请填写正确的手机号',
						    className: 'bluelayer',
						    time: 2
						});
                      return;
            	}


                if(result.result==1){
		 	         $("#step1").hide();
		 	         $("#step2").fadeIn(500);
		 	         userid = result.insert_id;
		 	         phonenumber = $("#phonenumber").val();
		 	         $("#sendphonenumber").html(phonenumber);

		 	         currentstep ++;

                     layer.closeAll();

                     //$("html, body").scrollTop(0).animate({scrollTop: $("#scroll").offset().top});

                     $('html, body').animate({scrollTop:220}, 'slow'); 
                      return;
		 	         //send sms

                }else{
                      layer.open({
						    content: '请填写完整',
						    className: 'bluelayer',
						    time: 2
						});
                      return;

                }
                posting = false;
            }
        });

    }

    function sendInfo_2(){

    	var smscode = $("#smscode").val();
    	var password = $("#password").val();

        $.ajax({
            url: '/api_createinfo_2.php',
            type: 'POST',
            data:{ userid:userid,smscode:smscode,password:password},
            dataType: 'json',
            error: function(){
                  alert('Error loading PHP document'); 
                  posting = false;
                 },
            success: function(result){
 
                if(result.result==1){

			         $("#step2").hide();
			         $("#step3").fadeIn(500);
			         currentstep ++;
                    $('html, body').animate({scrollTop:220}, 'slow'); 

                }else{
                     alert("请填写完整");
                }
                posting = false;
            }
        });
    }

    function sendInfo_3(){
    	
       var userthumb = $("#userthumb").attr("src");
       var selfintro = $("#selfintro").val();
       var sporttitle = $("#sporttitle").val();
       var resume = $("#resume").val();

        $.ajax({
            url: '/api_createinfo_3.php',
            type: 'POST',
            data:{ userid:userid,userthumb:userthumb,selfintro:selfintro,sporttitle:sporttitle,resume:resume},
            dataType: 'json',
            error: function(){
                  alert('Error loading PHP document'); 
                  posting = false;
                 },
            success: function(result){


                if(result.result==1){
                      showlayer("已完成注册");
			         $("#step3").hide();
			         $("#step4").fadeIn(500);

                      $("#submitButton").hide();
                      currentstep ++;
		 	         //send sms
                     $('html, body').animate({scrollTop:220}, 'slow'); 

                }else{
                     alert("请填写完整");
                }
                posting = false;
            }
        });


    }



</script>

</body>
</html>